#ifndef AUDIORECORDER_H
#define AUDIORECORDER_H

#include <QWidget>

QT_BEGIN_NAMESPACE
namespace Ui { class AudioRecorder; }
QT_END_NAMESPACE

#include <QAudioRecorder>
#include <QAudioProbe>

class AudioRecorder : public QWidget
{
    Q_OBJECT

public:
    AudioRecorder(QWidget *parent = nullptr);
    ~AudioRecorder();

private slots:
    ///自定义槽函数
    void onStateChanged (QMediaRecorder::State state) ;
    void onDurationChanged(qint64 duration) ;
    void processBuffer (const QAudioBuffer& buffer) ;
    void on_btnRecord_clicked();

    void on_btnPause_clicked();

    void on_btnStop_clicked();

    void on_btnGetFile_clicked();

    void on_btnQuit_clicked();

private:
    Ui::AudioRecorder *ui;

    QAudioRecorder * m_pAudioRecorder = nullptr;
    QAudioProbe * m_pAudioProbe = nullptr;
};
#endif // AUDIORECORDER_H
